/*   1:    */ package com.jetbrains.licenseServer.openapi.util;
/*   2:    */ 
/*   3:    */

import com.jetbrains.licenseServer.openapi.requests.*;
import com.jetbrains.licenseServer.openapi.responses.*;

import java.io.IOException;
import java.util.UUID;
import java.util.prefs.Preferences;

/*   4:    */
/*   5:    */
/*   6:    */
/*   7:    */
/*   8:    */
/*   9:    */
/*  10:    */
/*  11:    */
/*  12:    */
/*  13:    */
/*  14:    */
/*  15:    */
/*  16:    */
/*  17:    */
/*  18:    */
/*  19:    */ 
/*  20:    */ public class ClientUtil
/*  21:    */ {
/*  22: 20 */   private static final String a = ;
/*  23: 21 */   private static final String b = System.getProperty("user.name", "<unknown>");
/*  24:    */   private static final String c;
/*  25:    */   
/*  26:    */   static
/*  27:    */   {
/*  28: 22 */     String str = Preferences.userRoot().get("JetBrains.UserIdOnMachine", null);
/*  29: 23 */     if ((str == null) || (str.length() == 0))
/*  30:    */     {
/*  31: 24 */       str = UUID.randomUUID().toString();
/*  32: 25 */       Preferences.userRoot().put("JetBrains.UserIdOnMachine", str);
/*  33:    */     }
/*  34: 27 */     c = str;
/*  35:    */   }
/*  36:    */   
/*  37: 28 */   private static final AbstractRequest.UserIdentification d = new AbstractRequest.UserIdentification(c, a, b);
/*  38:    */   
/*  39:    */   public static String getMachineId()
/*  40:    */   {
/*  41: 32 */     return d.getMachineId();
/*  42:    */   }
/*  43:    */   
/*  44:    */   public static String getHostName()
/*  45:    */   {
/*  46: 37 */     return d.getHostName();
/*  47:    */   }
/*  48:    */   
/*  49:    */   public static String getUserName()
/*  50:    */   {
/*  51: 41 */     return d.getUserName();
/*  52:    */   }
/*  53:    */   
/*  54:    */   private static AbstractRequest.UserIdentification a()
/*  55:    */   {
/*  56: 45 */     return d;
/*  57:    */   }
/*  58:    */   
/*  59:    */   public static ObtainTicketResponse obtainTicket(String paramString, UUID paramUUID, int paramInt1, int paramInt2, boolean paramBoolean)
/*  60:    */     throws VerificationFailedException, IOException
/*  61:    */   {
/*  62: 50 */     ObtainTicketRequest localObtainTicketRequest = new ObtainTicketRequest(System.currentTimeMillis(), paramUUID.toString(), paramInt1, paramInt2, paramBoolean, c, getHostName(), getUserName());
/*  63:    */     
/*  64:    */ 
/*  65:    */ 
/*  66:    */ 
/*  67:    */ 
/*  68:    */ 
/*  69:    */ 
/*  70:    */ 
/*  71: 59 */     return (ObtainTicketResponse)RpcUtil.executeRpc(paramString, localObtainTicketRequest);
/*  72:    */   }
/*  73:    */   
/*  74:    */   public static GetPermanentActivationResponse obtainPermanentActivationCode(String paramString1, UUID paramUUID, String paramString2)
/*  75:    */     throws VerificationFailedException, IOException
/*  76:    */   {
/*  77: 63 */     GetPermanentActivationRequest localGetPermanentActivationRequest = new GetPermanentActivationRequest(System.currentTimeMillis(), paramUUID.toString(), paramString2, c, getHostName(), getUserName());
/*  78:    */     
/*  79:    */ 
/*  80:    */ 
/*  81:    */ 
/*  82:    */ 
/*  83:    */ 
/*  84:    */ 
/*  85: 71 */     return (GetPermanentActivationResponse)RpcUtil.executeRpc(paramString1, localGetPermanentActivationRequest);
/*  86:    */   }
/*  87:    */   
/*  88:    */   public static ObtainPermanentTicketResponse obtainPermanentTicket(String paramString1, UUID paramUUID, int paramInt1, int paramInt2, boolean paramBoolean, String paramString2, String paramString3)
/*  89:    */     throws VerificationFailedException, IOException
/*  90:    */   {
/*  91: 77 */     ObtainPermanentTicketRequest localObtainPermanentTicketRequest = new ObtainPermanentTicketRequest(System.currentTimeMillis(), paramUUID.toString(), paramInt1, paramInt2, paramBoolean, c, getHostName(), getUserName(), paramString2, paramString3);
/*  92:    */     
/*  93:    */ 
/*  94:    */ 
/*  95:    */ 
/*  96:    */ 
/*  97:    */ 
/*  98:    */ 
/*  99:    */ 
/* 100:    */ 
/* 101:    */ 
/* 102: 88 */     return (ObtainPermanentTicketResponse)RpcUtil.executeRpc(paramString1, localObtainPermanentTicketRequest);
/* 103:    */   }
/* 104:    */   
/* 105:    */   public static PingResponse ping(String paramString)
/* 106:    */     throws VerificationFailedException, IOException
/* 107:    */   {
/* 108: 92 */     PingRequest localPingRequest = new PingRequest();
/* 109: 93 */     localPingRequest.setSalt(System.currentTimeMillis());
/* 110: 94 */     return (PingResponse)RpcUtil.executeRpc(paramString, localPingRequest);
/* 111:    */   }
/* 112:    */   
/* 113:    */   public static ProlongTicketResponse prolongTicket(String paramString1, String paramString2, UUID paramUUID)
/* 114:    */     throws VerificationFailedException, IOException
/* 115:    */   {
/* 116: 98 */     ProlongTicketRequest localProlongTicketRequest = new ProlongTicketRequest(System.currentTimeMillis(), paramString2, paramUUID.toString(), c, getHostName(), getUserName());
/* 117:    */     
/* 118:    */ 
/* 119:    */ 
/* 120:    */ 
/* 121:    */ 
/* 122:    */ 
/* 123:    */ 
/* 124:    */ 
/* 125:107 */     return (ProlongTicketResponse)RpcUtil.executeRpc(paramString1, localProlongTicketRequest);
/* 126:    */   }
/* 127:    */   
/* 128:    */   public static ReleaseTicketResponse releaseTicket(String paramString1, String paramString2, UUID paramUUID)
/* 129:    */     throws VerificationFailedException, IOException
/* 130:    */   {
/* 131:111 */     ReleaseTicketRequest localReleaseTicketRequest = new ReleaseTicketRequest(System.currentTimeMillis(), paramUUID.toString(), paramString2, c, getHostName(), getUserName());
/* 132:    */     
/* 133:    */ 
/* 134:    */ 
/* 135:    */ 
/* 136:    */ 
/* 137:    */ 
/* 138:    */ 
/* 139:    */ 
/* 140:120 */     return (ReleaseTicketResponse)RpcUtil.executeRpc(paramString1, localReleaseTicketRequest);
/* 141:    */   }
/* 142:    */ }



/* Location:           E:\idea\

 * Qualified Name:     com.jetbrains.licenseServer.openapi.util.ClientUtil

 * JD-Core Version:    0.7.0.1

 */